package io.netty.server.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/** 
 * @author  lianlb 
 * @date 2017年11月5日  下午9:48:40 
 * @version 1.0 
 */
public final class PropertiesUtil {
	
	private static Properties pros;
	static {
		pros = new Properties();
		try {
			pros.load(new FileInputStream("conf.properties"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * @param key
	 * @return
	 */
	public static String getString(String key) {
		String value = pros.getProperty(key);
		return value;
	}
	/**
	 * @param key
	 * @return
	 */
	public static int getInt(String key) {
		int value = Integer.valueOf(pros.getProperty(key));
		return value;
	}
	
}
